home *** CD-ROM | disk | FTP | other *** search
/ Space Shuttle - The First 100 Flights / Space Shuttle - The First 100 Flights.iso / xTras / DirectMedia Xtra Behaviors.cst / 00003_Script_DirectMedia Xtra Controller Button < prev    next >
Text File  |  2000-01-16  |  4KB  |  76 lines

  1. --DirectMedia Xtra Controller Button   
  2.  
  3. property videoSprite    -- the sprite number that is getting controlled
  4. property videoCommand   -- the command to be issued
  5. property standardImage  -- the Button Image
  6. property alternateImage -- the Rollover Image for the button
  7. property clickedImage   -- the Clicked Image for the button rollover and click.
  8. property param1  -- first parameter of the command
  9. property param2  -- second parameter of the command
  10.  
  11. on DoControl me
  12.   case ( the VideoCommand of me ) of:
  13.     #Play:
  14.       videoplay(sprite the videoSprite of me)
  15.     #Pause:
  16.       videopause(sprite the videoSprite of me)
  17.     #Rewind:
  18.       videoseek(sprite the videoSprite of me, the segmentstart of sprite the videoSprite of me)
  19.     #StepForward:
  20.       videopause(sprite the videoSprite of me)
  21.       videoseek(sprite the videoSprite of me, the currenttime of sprite the videoSprite of me+30)
  22.     #StepBackward:
  23.       videopause(sprite the videoSprite of me)
  24.       videoseek(sprite the videoSprite of me, the currenttime of sprite the videoSprite of me-30)
  25.     #Seek:
  26.       videoseek(sprite the videoSprite of me, the param1 of me)
  27.     #PlaySegment:
  28.       videoplaysegment(sprite the videoSprite of me, the param1 of me, the param2 of me)
  29.       
  30.   end case
  31. end
  32.  
  33.  
  34. on mouseUp me
  35.   set the member of sprite the spritenum of me = the standardImage of me
  36.   DoControl me
  37. end
  38.  
  39. on mouseDown me
  40.   set the member of sprite the spritenum of me = the clickedImage of me
  41. end  
  42.  
  43. on mouseEnter me
  44.   set the member of sprite the spritenum of me = the alternateImage of me
  45. end  
  46.  
  47. on mouseLeave me
  48.   set the member of sprite the spritenum of me = the standardImage of me
  49. end
  50.  
  51. ---
  52.  
  53. on beginSprite me
  54.   set the standardImage of me = the member of sprite the spriteNum of me
  55. end
  56.  
  57. ---
  58.  
  59. on getPropertyDescriptionList
  60.   if the currentspritenum = 0 then 
  61.     set memdefault = 0 
  62.   else
  63.     set memref = the member of sprite the currentspritenum
  64.     set memdefault = member (the membernum of member memref + 1) 
  65.     set memdefault2 = member (the membernum of member memref + 2) 
  66.   end if
  67.   
  68.   set p_list = [   #videoCommand: [ #comment:   "Action:",#format:   #symbol,   #range: [ #Play, #Pause, #Rewind,#StepBackward,#StepForward, #Seek, #PlaySegment],#default:   #Play ], #param1: [ #comment:   "First Parameter (Use with seek or playsegment):", #format:   #long, #default:    0] , #param2: [ #comment:   "Second Parameter (Use with playsegment):", #format: #long,   #default:    0] ,  #videoSprite: [ #comment:   "DirectMedia Sprite Channel:", #format:   #integer,   #default:    1] ,    #alternateImage: [ #comment:   "Rollover Button Cast Member:",                     #format:   #graphic,                    #default:    memdefault ], #clickedImage: [ #comment:   "Clicked Button Cast Member:",                     #format:   #graphic,                    #default:    memdefault2 ]]                  
  69.   return p_list
  70. end
  71.  
  72. on getBehaviorDescription
  73.   return "Used to create Play, Pause, StepForward, StepBackward, Rewind, Seek and PlaySegment control buttons for a DirectMedia Xtra video sprite. You can also attach rollover and alternate images for the clicked buttons" & RETURN & "PARAMETERS:" & RETURN & "Action - Choose the action to perform on mouseUP ( Play, Pause, Rewind, StepBackward, StepForward, Seek, PlaySegment )." & RETURN & "First Parameter: if the Action is Seek than this parameter contains the seek to time (in milliseconds). For the PlaySegment action this parameter contains the starting time of the segment to play (in milliseconds)"& RETURN &"Second Parameter: Used with the PlaySegment action. Contains the ending time of the segment to play (in milliseconds)"& RETURN &"DirectMedia Sprite Channel - Enter the number of sprite channel of the DirectMedia Xtra video that is being controlled."& RETURN &"Rollover Button: the castmember that will be used as the rollover image of the button. Default is the castmember located just after the button castmember"& RETURN&"Clicked Button: the castmember that will be used as the clicked image of the button. Default is the castmember located just after the rollover castmember"
  74. end
  75.  
  76.